<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>VirtualBox创建Ubuntu虚拟机 | Memory</title><meta name="keywords" content="Linux"><meta name="author" content="Memory"><meta name="copyright" content="Memory"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="1. 安装VirtualBox到 VirtualBox 下载并安装即可。 2. 下载Ubuntu镜像镜像地址：  官方下载地址（比较慢）  中科大源   阿里云源  兰州大学源  北理工源  浙大源   选择自己需要的版本，我安装的是 ubuntu 16.04。 3.创建虚拟机 点击新建   名称随便填，文件夹可以使用默认的也可以自己改，然后选一下类型。   分配内存，我有16G的内存，所以分了4">
<meta property="og:type" content="article">
<meta property="og:title" content="VirtualBox创建Ubuntu虚拟机">
<meta property="og:url" content="http://memoryd.gitee.io/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/index.html">
<meta property="og:site_name" content="Memory">
<meta property="og:description" content="1. 安装VirtualBox到 VirtualBox 下载并安装即可。 2. 下载Ubuntu镜像镜像地址：  官方下载地址（比较慢）  中科大源   阿里云源  兰州大学源  北理工源  浙大源   选择自己需要的版本，我安装的是 ubuntu 16.04。 3.创建虚拟机 点击新建   名称随便填，文件夹可以使用默认的也可以自己改，然后选一下类型。   分配内存，我有16G的内存，所以分了4">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://memoryd.gitee.io/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151255796.png">
<meta property="article:published_time" content="2021-03-26T03:12:51.000Z">
<meta property="article:modified_time" content="2021-03-26T03:14:33.000Z">
<meta property="article:author" content="Memory">
<meta property="article:tag" content="Linux">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://memoryd.gitee.io/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151255796.png"><link rel="shortcut icon" href="/images/favicon_02.png"><link rel="canonical" href="http://memoryd.gitee.io/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-03-26 11:14:33'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const fontSizeVal = saveToLocal.get('global-font-size')
    if (fontSizeVal !== undefined) {
      document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
    }
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/images/head.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">6</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">5</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151255796.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Memory</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">VirtualBox创建Ubuntu虚拟机</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-03-26T03:12:51.000Z" title="发表于 2021-03-26 11:12:51">2021-03-26</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-03-26T03:14:33.000Z" title="更新于 2021-03-26 11:14:33">2021-03-26</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Linux/">Linux</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="VirtualBox创建Ubuntu虚拟机"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h3 id="1-安装VirtualBox"><a href="#1-安装VirtualBox" class="headerlink" title="1. 安装VirtualBox"></a>1. 安装VirtualBox</h3><p>到 <a target="_blank" rel="noopener" href="https://www.virtualbox.org/wiki/Downloads">VirtualBox</a> 下载并安装即可。</p>
<h3 id="2-下载Ubuntu镜像"><a href="#2-下载Ubuntu镜像" class="headerlink" title="2. 下载Ubuntu镜像"></a>2. 下载Ubuntu镜像</h3><p>镜像地址：</p>
<ul>
<li><p><a target="_blank" rel="noopener" href="https://www.ubuntu.com/download">官方下载地址（比较慢）</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="http://mirrors.ustc.edu.cn/ubuntu-releases/">中科大源</a> </p>
</li>
<li><p><a target="_blank" rel="noopener" href="http://mirrors.aliyun.com/ubuntu-releases/">阿里云源</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="http://mirror.lzu.edu.cn/ubuntu-releases/">兰州大学源</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="http://mirror.bit.edu.cn/ubuntu-releases/">北理工源</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="http://mirrors.zju.edu.cn/ubuntu-releases/">浙大源</a></p>
</li>
</ul>
<p>选择自己需要的版本，我安装的是 <code>ubuntu 16.04</code>。</p>
<h3 id="3-创建虚拟机"><a href="#3-创建虚拟机" class="headerlink" title="3.创建虚拟机"></a>3.创建虚拟机</h3><ol>
<li><p>点击新建</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827145809888.png" alt="image-20200827145809888"></p>
</li>
<li><p>名称随便填，文件夹可以使用默认的也可以自己改，然后选一下类型。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827145924915.png" alt="image-20200827145924915"></p>
</li>
<li><p>分配内存，我有16G的内存，所以分了4G给虚拟机。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150015167.png" alt="image-20200827150015167"></p>
</li>
<li><p>现在创建虚拟硬盘。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150045147.png" alt="image-20200827150045147"></p>
</li>
<li><p>选择VDI类型。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150108594.png" alt="image-20200827150108594"></p>
</li>
<li><p>动态分配就是用到了再分配，固定分配就是提前分配好，前者比较节省空间但是速度可能稍慢一些，如果硬盘够大可以选固定分配。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150239579.png" alt="image-20200827150239579"></p>
</li>
<li><p>硬盘大小就看你自己需求了。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150308287.png" alt="image-20200827150308287"></p>
</li>
<li><p>点击创建以后回到软件主界面，找到刚才创建的虚拟机，挂载上之前的镜像</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150500375.png" alt="image-20200827150500375"></p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150532313.png" alt="image-20200827150532313"></p>
</li>
<li><p>启动虚拟机。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150706734.png" alt="image-20200827150706734"></p>
</li>
</ol>
<h3 id="4-安装虚拟机"><a href="#4-安装虚拟机" class="headerlink" title="4. 安装虚拟机"></a>4. 安装虚拟机</h3><ol>
<li><p>选择语言，点击安装。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827150859433.png" alt="image-20200827150859433"></p>
</li>
<li><p>如图。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151022827.png" alt="image-20200827151022827"></p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151041292.png" alt="image-20200827151041292"></p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151056874.png" alt="image-20200827151056874"></p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151131503.png" alt="image-20200827151131503"></p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151141972.png" alt="image-20200827151141972"></p>
</li>
<li><p>设置密码</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151224387.png" alt="image-20200827151224387"></p>
</li>
<li><p>等待。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151255796.png" alt="image-20200827151255796"></p>
</li>
</ol>
<h3 id="5-配置共享文件夹"><a href="#5-配置共享文件夹" class="headerlink" title="5. 配置共享文件夹"></a>5. 配置共享文件夹</h3><ol>
<li><p>安装增强工具，点击这个选项以后，等一会桌面会多出一个光盘图标。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827152518293.png" alt="image-20200827152518293"></p>
</li>
<li><p>点进光盘，然后打开终端，运行命令：<code>sudo ./VboxLinuxAdditions.run</code>，等待安装完成以后重启虚拟机。</p>
</li>
<li><p>配置共享文件夹，选择固定分配。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827152800213.png" alt="image-20200827152800213"></p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827152824119.png" alt="image-20200827152824119"></p>
</li>
<li><p>然后在终端输入以下命令：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo mkdir /mnt/share</span><br><span class="line">sudo mount -t vboxsf share /mnt/share</span><br><span class="line">sudo gedit /etc/fstab</span><br></pre></td></tr></table></figure>

<p>为了使重启以后还能访问该文件夹，在文本末尾添加以下内容：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">share &#x2F;mnt&#x2F;share vboxsf rw,gid&#x3D;100,uid&#x3D;1000,auto 0 0</span><br></pre></td></tr></table></figure>

<p>注意，<code>share</code> 和 <code>/mnt/share</code> 要改成你自己设置的文件夹名称和挂载点，否则会无法开机。</p>
</li>
<li><p>为了便于查看共享文件夹，可以设置一个软链接：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ln -s /mnt/share ~/share</span><br></pre></td></tr></table></figure>

<p>然后就可以在 <code>home</code> 目录下看到该文件夹了。</p>
</li>
</ol>
<h3 id="6-apt换源"><a href="#6-apt换源" class="headerlink" title="6. apt换源"></a>6. apt换源</h3><p>由于默认的<code>apt</code>速度感人，所以我习惯换成国内源，我使用的是 <a target="_blank" rel="noopener" href="https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/">清华源</a> 。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827153543383.png" alt="image-20200827153543383"></p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 备份</span></span><br><span class="line">sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup</span><br><span class="line"><span class="comment"># 编辑</span></span><br><span class="line">sudo gedit /etc/apt/sources.list</span><br></pre></td></tr></table></figure>

<p>然后粘贴以上的网站内的内容。</p>
<h3 id="7-虚拟机硬盘扩容"><a href="#7-虚拟机硬盘扩容" class="headerlink" title="7.虚拟机硬盘扩容"></a>7.虚拟机硬盘扩容</h3><ol>
<li><p>关闭虚拟机。</p>
</li>
<li><p>进入VirtualBox的安装目录，打开命令行，</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.\VBoxManage modifyhd <span class="string">&quot;C:\Users\Memory\VirtualBox VMs\PCL_Ubuntu\PCL_Ubuntu.vdi&quot;</span> --resize 61440</span><br></pre></td></tr></table></figure>

<p>上面的路径修改成你自己的虚拟硬盘路径，后面的大小根据自己想要调整的值进行，单位是MB。</p>
</li>
<li><p>启动虚拟机，打开终端，输入：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install gparted</span><br></pre></td></tr></table></figure>

<p>安装一个分区管理工具。</p>
</li>
<li><p>打开该程序，就可以进行扩容了。</p>
</li>
</ol>
<p>我自己从30G扩到了60G，硬盘吃紧。</p>
<p><img src="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200828153158264.png" alt="image-20200828153158264"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Memory</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://memoryd.gitee.io/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/">http://memoryd.gitee.io/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://memoryd.gitee.io" target="_blank">Memory</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Linux/">Linux</a></div><div class="post_share"><div class="social-share" data-image="/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151255796.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button button--animated"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/images/weixin.jpg" target="_blank"><img class="post-qr-code-img" src="/images/weixin.jpg" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="/images/alipay.jpg" target="_blank"><img class="post-qr-code-img" src="/images/alipay.jpg" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2021/03/26/Typora%E5%BF%AB%E6%8D%B7%E9%94%AE%E8%AE%BE%E7%BD%AE/"><img class="prev-cover" src="/2021/03/26/Typora%E5%BF%AB%E6%8D%B7%E9%94%AE%E8%AE%BE%E7%BD%AE/22685991-c5570dd551eb96e9.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Typora快捷键设置</div></div></a></div><div class="next-post pull-right"><a href="/2021/03/24/%E4%BD%BF%E7%94%A8Hexo%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/"><img class="next-cover" src="/images/cover_02.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">使用Hexo+Gitee搭建个人博客</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="/images/head.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">Memory</div><div class="author-info__description">桃李春风一杯酒，江湖夜雨十年灯</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">6</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">5</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/MemoryD"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/MemoryD" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://gitee.com/MemoryD" target="_blank" title="Gitee"><i class="fas fa-keyboard"></i></a><a class="social-icon" href="mailto:memory_d@foxmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">Welcome to Memory's Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E5%AE%89%E8%A3%85VirtualBox"><span class="toc-number">1.</span> <span class="toc-text">1. 安装VirtualBox</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E4%B8%8B%E8%BD%BDUbuntu%E9%95%9C%E5%83%8F"><span class="toc-number">2.</span> <span class="toc-text">2. 下载Ubuntu镜像</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E5%88%9B%E5%BB%BA%E8%99%9A%E6%8B%9F%E6%9C%BA"><span class="toc-number">3.</span> <span class="toc-text">3.创建虚拟机</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-%E5%AE%89%E8%A3%85%E8%99%9A%E6%8B%9F%E6%9C%BA"><span class="toc-number">4.</span> <span class="toc-text">4. 安装虚拟机</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-%E9%85%8D%E7%BD%AE%E5%85%B1%E4%BA%AB%E6%96%87%E4%BB%B6%E5%A4%B9"><span class="toc-number">5.</span> <span class="toc-text">5. 配置共享文件夹</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-apt%E6%8D%A2%E6%BA%90"><span class="toc-number">6.</span> <span class="toc-text">6. apt换源</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#7-%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%A1%AC%E7%9B%98%E6%89%A9%E5%AE%B9"><span class="toc-number">7.</span> <span class="toc-text">7.虚拟机硬盘扩容</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/07/31/%E6%B7%98%E5%AE%9D%E9%AA%8C%E5%8F%B7%E8%BD%AF%E4%BB%B6%E4%BD%BF%E7%94%A8/" title="淘宝验号软件使用"><img src="/2021/07/31/%E6%B7%98%E5%AE%9D%E9%AA%8C%E5%8F%B7%E8%BD%AF%E4%BB%B6%E4%BD%BF%E7%94%A8/image-20210731223330659.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="淘宝验号软件使用"/></a><div class="content"><a class="title" href="/2021/07/31/%E6%B7%98%E5%AE%9D%E9%AA%8C%E5%8F%B7%E8%BD%AF%E4%BB%B6%E4%BD%BF%E7%94%A8/" title="淘宝验号软件使用">淘宝验号软件使用</a><time datetime="2021-07-31T12:07:54.000Z" title="发表于 2021-07-31 20:07:54">2021-07-31</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/06/01/%E3%80%90%E8%AF%97%E3%80%91%E6%88%91%E4%BA%A6%E5%A5%BD%E6%AD%8C%E4%BA%A6%E5%A5%BD%E9%85%92/" title="《我亦好歌亦好酒》————殊同"><img src="/2021/06/01/%E3%80%90%E8%AF%97%E3%80%91%E6%88%91%E4%BA%A6%E5%A5%BD%E6%AD%8C%E4%BA%A6%E5%A5%BD%E9%85%92/cover.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="《我亦好歌亦好酒》————殊同"/></a><div class="content"><a class="title" href="/2021/06/01/%E3%80%90%E8%AF%97%E3%80%91%E6%88%91%E4%BA%A6%E5%A5%BD%E6%AD%8C%E4%BA%A6%E5%A5%BD%E9%85%92/" title="《我亦好歌亦好酒》————殊同">《我亦好歌亦好酒》————殊同</a><time datetime="2021-06-01T02:43:32.000Z" title="发表于 2021-06-01 10:43:32">2021-06-01</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/04/16/QMK%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" title="QMK环境配置"><img src="/2021/04/16/QMK%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/image-20210416101604830.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="QMK环境配置"/></a><div class="content"><a class="title" href="/2021/04/16/QMK%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" title="QMK环境配置">QMK环境配置</a><time datetime="2021-04-16T01:09:53.000Z" title="发表于 2021-04-16 09:09:53">2021-04-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/04/15/%E3%80%90%E8%AF%97%E3%80%91%E6%A1%83%E8%8A%B1%E5%BA%B5%E6%AD%8C/" title="《桃花庵歌》 —— 唐寅"><img src="/2021/04/15/%E3%80%90%E8%AF%97%E3%80%91%E6%A1%83%E8%8A%B1%E5%BA%B5%E6%AD%8C/u=162093079,1320654252&amp;fm=26&amp;gp=0.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="《桃花庵歌》 —— 唐寅"/></a><div class="content"><a class="title" href="/2021/04/15/%E3%80%90%E8%AF%97%E3%80%91%E6%A1%83%E8%8A%B1%E5%BA%B5%E6%AD%8C/" title="《桃花庵歌》 —— 唐寅">《桃花庵歌》 —— 唐寅</a><time datetime="2021-04-15T10:58:24.000Z" title="发表于 2021-04-15 18:58:24">2021-04-15</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/31/%E3%80%90%E8%AF%97%E3%80%91%E6%97%A0%E9%A2%98/" title="《无题》—— 马东"><img src="/2021/03/31/%E3%80%90%E8%AF%97%E3%80%91%E6%97%A0%E9%A2%98/cover.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="《无题》—— 马东"/></a><div class="content"><a class="title" href="/2021/03/31/%E3%80%90%E8%AF%97%E3%80%91%E6%97%A0%E9%A2%98/" title="《无题》—— 马东">《无题》—— 马东</a><time datetime="2021-03-31T01:15:24.000Z" title="发表于 2021-03-31 09:15:24">2021-03-31</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/2021/03/26/VirtualBox%E5%88%9B%E5%BB%BAUbuntu%E8%99%9A%E6%8B%9F%E6%9C%BA/image-20200827151255796.png')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By Memory</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Have fun here!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"></div><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>